<?php
	error_reporting(E_ERROR | E_WARNING | E_PARSE);
	ini_set('display_errors', 1);
	set_time_limit(6000);
	date_default_timezone_set('Europe/London');
	ini_set('memory_limit', '512M');

	// Start the session
	session_start();
	if($_GET['clear_session'] == true)
	{
		session_destroy();
		session_regenerate_id();
		session_start();
	}

	switch($_SERVER['SERVER_NAME'])
	{
		case 'framework.dev':
			DEFINE('SERVER_URL', 'http://framework.dev');
			DEFINE('ENVIRONMENT','DEVELOPMENT'); //used for cssless caching
		break;
	}

	// Connection to the database
	/*$mysqlID = mysql_connect(DB_HOST, DB_USERNAME, DB_PASSWORD) or die('Unable to connect to database');
	mysql_select_db(DB_DATABASE) or die('Unable to select database ' . DB_DATABASE);
	mysql_query("SET NAMES 'utf8'"); //should only call once during life of connection.

	mysql_set_charset("utf8", $mysqlID);*/

	
	// System classes, view and controller path
	DEFINE('ROUTER_PATH', '/');
	DEFINE('ASSETS_CSS', '/assets/css/');
	DEFINE('ASSETS_JS', '/assets/js/');
	DEFINE('ASSETS_IMAGES', '/assets/images/');
	DEFINE('SYSTEM_VIEWS', './system/views/'); //refer to the above
	DEFINE('SYSTEM_VIEWS_INC', './system/views/inc/'); //refer to the above
	DEFINE('SYSTEM_CONTROLLER', './system/controller/');
	DEFINE('SYSTEM_CONTROLLER_JSON', './system/controller/json/');
	DEFINE('SYSTEM_CONTROLLER_INC', './system/controller/inc/');
	DEFINE('SYSTEM_CLASSES', './system/classes/');
	DEFINE('SYSTEM_PLUGINS', './system/plugins/');
	DEFINE('SYSTEM_FUNCTIONS', './system/functions/');

?>